
//
//  AreaTableviewController.swift
//  SWfanghu
//
//  Created by 赵宇桥 on 16/6/7.
//  Copyright © 2016年 ly. All rights reserved.
//

import Foundation
import UIKit
class AreaTableviewController: UITableViewController {
    let citys = ["北京","上海","铁岭","石家庄"]
    weak var delegate:RegistController?
    override func viewDidLoad() {
        super.viewDidLoad()
        tableView.delegate = self
        tableView.dataSource = self
        tableView.backgroundColor = color_weak_background
        tableView.tableFooterView = UIView(frame: CGRectZero)
        tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell")
    }
    
    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int{
        return citys.count
    }
    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
        let cell = tableView.dequeueReusableCellWithIdentifier("cell")
        cell?.textLabel?.text = citys[indexPath.row]
        return cell!
    }
    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath){
        delegate?.cityInt = indexPath.row
        navigationController?.popViewControllerAnimated(true)
        
    }
    override func tableView(tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int){
        view.tintColor = UIColor.clearColor()
    }
    override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat{
        let h = CADipRectMake(0, 0, 0, 88)
        return h.height
    }
    
}